﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
  <base href="<%=basePath%>">
    <title>selectGoods.jsp</title>
	<link href="css/admin/common.css" type="text/css" rel="stylesheet">
	<style type="text/css">
		table{
			text-align: center;
			border-collapse: collapse;
		}
		.bgcolor{
		  	background-color: #F08080;
		}
	</style>
	<script type="text/javascript">
		function changeColor(obj){
			obj.className = "bgcolor";
		}
		function changeColor1(obj){
			obj.className = "";
		}
		
		function clearValue(){
			document.myForm.mykey.value = "";
		}
	</script>
</head>

<body>
<c:if test="${searchlist.size() == 0 }">
		您还没有商品。
	</c:if>
	<c:if test="${searchlist.size() != 0 }">
	<form action="adminGoods/searchGoods" name="myForm" method="post">
		查询商品名称：			
		<input type="text" name="mykey" class="txt" value="请输入您要查询的内容"  onfocus="clearValue()" />
		<input type="submit"  value="查询" />
		</form>
		<table border="1" bordercolor="PaleGreen">
			<tr>
				<th width="100px">ID</th>
				<th width="200px">名称</th>
				<th width="200px">价格</th>
				<th width="100px">库存</th>
				<th width="200px">详情</th>
			</tr>
			<c:forEach items="${searchlist }" var="goods">
				<tr onmousemove="changeColor(this)" onmouseout="changeColor1(this)">
					<td>${goods.id }</td>
					<td>${goods.gname }</td>
					<td>${goods.grprice }</td>
					<td>${goods.gstore }</td>
					<td><a href="adminGoods/selectAGoods?id=${goods.id }" target="_blank">详情</a></td>
				</tr>
			</c:forEach>
		
		</table>
	</c:if>
	
</body>
</html>